# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-cisco-copyconfig
_pkgname=Cisco-CopyConfig
pkgver=1.4
pkgrel=13
pkgdesc='IOS running-config manipulation.'
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl-net-snmp')
makedepends=()
url='http://search.cpan.org/dist/Cisco-CopyConfig'
source=("http://search.cpan.org/CPAN/authors/id/A/AA/AARONSCA/$_pkgname-$pkgver.tgz")
sha512sums=('80ee4e38bb3db9778bed6469fd2d650f74e793380f26c3e0d28e91d35f434ffb7c8fe8e99c98e4d72b2c3b2df931ac0776a83e0cbed977fb0b60f12a6007516b')
_distdir="$_pkgname-$pkgver"

build() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
      PERL_AUTOINSTALL=--skipdeps                            \
      PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'"     \
      PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
      MODULEBUILDRC=/dev/null

    cd "$_distdir"
    /usr/bin/perl Makefile.PL
    make
  )
}

package() {
  cd "$_distdir"

  make install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

